package org.br.erp.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.br.erp.base.entity.Scmstocklocation;
import org.br.erp.base.mapper.ScmstocklocationMapper;
import org.br.erp.base.service.IScmstocklocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 货位管理
 * @Author: jeecg-boot
 * @Date:   2022-08-31
 * @Version: V1.0
 */
@Service
public class ScmstocklocationServiceImpl extends ServiceImpl<ScmstocklocationMapper, Scmstocklocation> implements IScmstocklocationService {

    @Autowired
    ScmstocklocationMapper scmstocklocationMapper;

    @Override
    public Scmstocklocation getStocklocationbyname(String stocklocationame) {
        LambdaQueryWrapper<Scmstocklocation> lambdaQueryWrapper=new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Scmstocklocation::getLocationname,stocklocationame);
        List<Scmstocklocation> scmstocklocations = scmstocklocationMapper.selectList(lambdaQueryWrapper);
        if(scmstocklocations.size()>0){
            return scmstocklocations.get(0);
        }else{
            return null;
        }
    }
}
